package com.lanou.elh.sysmanage.system_management.web.controller;

import com.lanou.elh.sysmanage.authority_management.common.Result;
import com.lanou.elh.sysmanage.authority_management.common.ResultUtil;
import com.lanou.elh.sysmanage.system_management.entity.TbBase;
import com.lanou.elh.sysmanage.system_management.service.BaseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BaseController {

    @Autowired
    private BaseService baseService;

    @GetMapping("/user/selectbase")
    @ApiOperation(value = "查看系统")
    public Result<List<TbBase>> selectBase() {
        List<TbBase> tbBases = baseService.selectBase();
        return new ResultUtil<List<TbBase>>().setData(tbBases);
    }

    @PostMapping("/admin/updateBase")
    @ApiOperation(value = "修改系统信息")
    public Result updateBase(TbBase base) {
        baseService.updateBase(base);
        return new ResultUtil<>().setData(null);
    }

}
